Skip to content

Instantly share code, notes, and snippets.

View harujoh's full-sized avatar
💭
I'm fine.

harujoh

💭
I'm fine.
View GitHub Profile
@harujoh
harujoh / ctstring.h.txt
Last active December 3, 2021 07:18
tensorflow/core/platform/ctstring.hの日本語訳
C-API functions TF_StringDecode, TF_StringEncode, and TF_StringEncodedSize are no longer relevant and have been removed;
see core/platform/ctstring.h for string access/modification in C.
●TF_CAPI_EXPORT extern void TF_StringInit(TF_TString *t);
■inline void TF_TString_Init(TF_TString *str);
Initialize a new tstring.
This must be called before using any function below.
新しいtstringを初期化します。
以下の関数を使用する前に必ず呼び出す必要があります。
@harujoh
harujoh / schema.c
Last active March 31, 2021 00:44
schema.fbsの和訳
// Copyright 2017 The TensorFlow Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@harujoh
harujoh / TF_GetAllOpList.txt
Created March 9, 2021 01:58
TF_GetAllOpList
TF_Version : 2.4.0
_Arg
_ArrayToList
_ConfigureDistributedTPU
_DeviceArg
_DeviceRetval
_DisconnectHostFromDistributedTPUSystem
_FusedBatchNormEx
_FusedConv2D
_FusedDepthwiseConv2dNative
@harujoh
harujoh / MinTensorFlow.cs
Created February 16, 2021 05:15
たし算をTensorFlow.dll上で実行
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace MinTensorFlow
{
[StructLayout(LayoutKind.Sequential)]
internal struct TF_Status
{
IntPtr status; //tensorflow::Status status;
@harujoh
harujoh / ClassLibrary1.csproj
Created September 23, 2020 01:09
NetStandardのバージョン判定
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.6;netstandard2.0;netstandard2.1</TargetFrameworks>
<DefineConstants Condition="$(TargetFramework.Contains('netstandard')) and $(TargetFramework.Length) > 12 and
$([System.Version]::Parse('$(TargetFramework.Replace('netstandard',''))').CompareTo($([System.Version]::Parse('2.1')))) >= 0">
NETSTANDARD2_1_OR_GREATER
</DefineConstants>
</PropertyGroup>
@harujoh
harujoh / AutoDiff.cs
Last active February 7, 2021 14:03
トップダウン型の自動微分
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
@harujoh
harujoh / MinimunPaint.cs
Created October 3, 2019 02:55
ペイント超簡易版
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
Point posPrevious;
public Form1()
@harujoh
harujoh / NativeMem2NativeMem.cs
Created July 24, 2019 09:05
ネイティブからネイティブへのコピー速度比較
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
namespace ConsoleApp75
{
class Program
{
@harujoh
harujoh / ArrayExtension.cs
Last active February 19, 2019 02:13
Array.Reshape(param int[])で次元を変えられる拡張メソッド
internal static class ArrayExtension
{
[SuppressUnmanagedCodeSecurity]
[DllImport("kernel32.dll", EntryPoint = "CopyMemory", SetLastError = false)]
public static extern void CopyMemory(IntPtr dest, IntPtr src, int count);
public static Array Reshape(this Array array, params int[] shape)
{
Array result = Array.CreateInstance(array.GetType().GetElementType(), shape);
@harujoh
harujoh / GetFunctionPointer.cs
Last active March 9, 2020 14:46
関数ポインタと呼ばれし者たちの墓
using System;
using System.IO;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace ConsoleApp60
{
class Program